package com.dys.servlet;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @className: com.dys.servlet.Servlet03
 * @description: ServletConfig配置对象
 * @author: pine cone
 * @version: v1.0.0
 * @createTime: 2024/09/19 23:01
 */
public class Servlet03 extends HttpServlet {

    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        ServletConfig servletConfig = this.getServletConfig();
        String brand = servletConfig.getInitParameter("brand");
        System.out.println("品牌：" + brand);
        String size = servletConfig.getInitParameter("size");
        System.out.println("大小：" + size);
    }
}
